package edu.qd.learn.newchapter.chapter03.patter;

/**
 * 工厂设计模式
 *
 * @author 布衣
 */
public class PetFactoryPatter {

    private static String storeName = "老康宠物店";

    /**
     * 此方法用来生成大量的宠物
     */
    public static Pet createPet(PetEnum type){
        if(type == PetEnum.bird){
            return new Bird(storeName);
        }else if(type == PetEnum.flay){
            return new Flay(storeName);
        }else{
            return null;
        }
    }


//
//    public ClassType checkUserOrPasword(){
//        return ClassType.USER_OR_PASSWORD_ERROR;
//    }

    public static void main(String[] args) {
        Pet pet = PetFactoryPatter.createPet(PetEnum.bird);
        Bird bird = (Bird) PetFactoryPatter.createPet(PetEnum.flay);
    }
}
